2025-03-26 03:50:05,933 - INFO - Num classes: 4
2025-03-26 03:51:32,769 - INFO - Class weights: tensor([0.3660, 6.9287, 2.1070, 1.5411], device='cuda:0')
2025-03-26 03:51:34,821 - INFO - Model architecture:
CombinedModelCNN(
  (unet): Unet(
    (conv1): Sequential(
      (0): Conv2d(1024, 8, kernel_size=(5, 5), stride=(1, 1), padding=(5, 5))
      (1): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(8, 8, kernel_size=(5, 5), stride=(1, 1), padding=(5, 5))
      (4): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
    )
    (conv2): Sequential(
      (0): Conv2d(8, 16, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2))
      (1): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(16, 16, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2))
      (4): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
    )
    (conv3): Sequential(
      (0): Conv2d(16, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(32, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (4): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
    )
    (upconv3): Sequential(
      (0): Conv2d(32, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (1): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(16, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (4): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): ConvTranspose2d(16, 16, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))
    )
    (upconv2): Sequential(
      (0): Conv2d(32, 8, kernel_size=(4, 4), stride=(1, 1), padding=(1, 1))
      (1): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(8, 8, kernel_size=(4, 4), stride=(1, 1), padding=(1, 1))
      (4): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): ConvTranspose2d(8, 8, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))
    )
    (upconv1): Sequential(
      (0): Conv2d(16, 4, kernel_size=(6, 6), stride=(1, 1), padding=(1, 1))
      (1): BatchNorm2d(4, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(4, 4, kernel_size=(6, 6), stride=(1, 1), padding=(1, 1))
      (4): BatchNorm2d(4, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): ConvTranspose2d(4, 4, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))
    )
  )
  (san): ImprovedHyperspectralLogisticRegressionModel(
    (spectral_attention): SpectralAttention(
      (fc): Sequential(
        (0): Linear(in_features=1024, out_features=64, bias=True)
        (1): ReLU(inplace=True)
        (2): Linear(in_features=64, out_features=1024, bias=True)
        (3): Sigmoid()
      )
    )
    (linear): Sequential(
      (0): LinearBlock(
        (block): Sequential(
          (0): Linear(in_features=1024, out_features=20, bias=True)
          (1): BatchNorm1d(20, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (2): LeakyReLU(negative_slope=0.1)
          (3): Dropout(p=0.0, inplace=False)
        )
      )
      (1): LinearBlock(
        (block): Sequential(
          (0): Linear(in_features=20, out_features=20, bias=True)
          (1): BatchNorm1d(20, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (2): LeakyReLU(negative_slope=0.1)
          (3): Dropout(p=0.0, inplace=False)
        )
      )
      (2): Linear(in_features=20, out_features=4, bias=True)
    )
    (logistic): Linear(in_features=4, out_features=4, bias=True)
  )
  (cnn): Sequential(
    (0): Conv2d(8, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (1): ReLU(inplace=True)
    (2): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (3): Dropout2d(p=0.2, inplace=False)
    (4): Conv2d(64, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (5): ReLU(inplace=True)
    (6): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (7): Dropout2d(p=0.2, inplace=False)
    (8): Conv2d(32, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (9): ReLU(inplace=True)
    (10): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (11): Dropout2d(p=0.2, inplace=False)
    (12): Conv2d(16, 4, kernel_size=(1, 1), stride=(1, 1))
  )
)
2025-03-26 03:51:34,821 - INFO - Using cuda device
2025-03-26 03:53:56,489 - INFO - Epoch: 0/100. Training time: 96.915
2025-03-26 03:53:56,490 - INFO - Training Metrics...
2025-03-26 03:53:56,490 - INFO - {'loss': 1.415949815795535, 'f1': 27.124390870084348, 'acc': 32.99174049464747, 'precision': 30.584632746822066, 'recall': 35.32304803899342, 'balanced acc': 35.32304803899342}
2025-03-26 03:53:56,490 - INFO - Validation Metrics... Inference time: 44.751
2025-03-26 03:53:56,490 - INFO - {'loss': 1.244985580444336, 'f1': 59.521433249950675, 'acc': 85.45137420718815, 'precision': 57.52589638485737, 'recall': 67.66840424948339, 'balanced acc': 67.66840424948339}
2025-03-26 03:53:56,490 - INFO - ==================================================
2025-03-26 04:04:29,260 - INFO - Epoch: 5/100. Training time: 111.677
2025-03-26 04:04:29,348 - INFO - Training Metrics...
2025-03-26 04:04:29,395 - INFO - {'loss': 0.6256845848900932, 'f1': 65.4503669069683, 'acc': 70.83277962347731, 'precision': 64.00098517324123, 'recall': 84.29000500105765, 'balanced acc': 84.29000500105765}
2025-03-26 04:04:29,395 - INFO - Validation Metrics... Inference time: 25.066
2025-03-26 04:04:29,396 - INFO - {'loss': 0.8246419429779053, 'f1': 63.06653898121043, 'acc': 78.52307963354475, 'precision': 59.72514809120072, 'recall': 84.0077936856801, 'balanced acc': 84.0077936856801}
2025-03-26 04:04:29,396 - INFO - ==================================================
2025-03-26 04:15:16,639 - INFO - Epoch: 10/100. Training time: 101.389
2025-03-26 04:15:16,704 - INFO - Training Metrics...
2025-03-26 04:15:16,705 - INFO - {'loss': 0.5853968518120902, 'f1': 67.67055935863799, 'acc': 75.00281469176818, 'precision': 65.16077474202542, 'recall': 85.41824080958365, 'balanced acc': 85.41824080958365}
2025-03-26 04:15:16,705 - INFO - Validation Metrics... Inference time: 40.290
2025-03-26 04:15:16,705 - INFO - {'loss': 0.6550105810165405, 'f1': 64.77233644577925, 'acc': 83.53047921071177, 'precision': 60.27666441093131, 'recall': 83.31811820101768, 'balanced acc': 83.31811820101768}
2025-03-26 04:15:16,705 - INFO - ==================================================
2025-03-26 04:25:08,290 - INFO - Epoch: 15/100. Training time: 107.520
2025-03-26 04:25:08,359 - INFO - Training Metrics...
2025-03-26 04:25:08,360 - INFO - {'loss': 0.5483112221672422, 'f1': 70.03074961005376, 'acc': 77.44209117755629, 'precision': 67.54774188190267, 'recall': 86.06872067491477, 'balanced acc': 86.06872067491477}
2025-03-26 04:25:08,360 - INFO - Validation Metrics... Inference time: 28.588
2025-03-26 04:25:08,360 - INFO - {'loss': 0.6260161995887756, 'f1': 66.22098947316891, 'acc': 86.12033121916842, 'precision': 61.5752694504043, 'recall': 82.06721646095073, 'balanced acc': 82.06721646095073}
2025-03-26 04:25:08,360 - INFO - ==================================================
2025-03-26 04:34:42,329 - INFO - Epoch: 20/100. Training time: 94.991
2025-03-26 04:34:42,377 - INFO - Training Metrics...
2025-03-26 04:34:42,447 - INFO - {'loss': 0.5244916791007632, 'f1': 71.16275091945508, 'acc': 80.99787744555185, 'precision': 68.3747582169363, 'recall': 85.73626016742948, 'balanced acc': 85.73626016742948}
2025-03-26 04:34:42,447 - INFO - Validation Metrics... Inference time: 10.588
2025-03-26 04:34:42,447 - INFO - {'loss': 0.6375661492347717, 'f1': 66.53883700587201, 'acc': 85.15345313601127, 'precision': 62.43561420906808, 'recall': 83.81586775892914, 'balanced acc': 83.81586775892914}
2025-03-26 04:34:42,447 - INFO - ==================================================
2025-03-26 04:45:11,726 - INFO - Epoch: 25/100. Training time: 80.930
2025-03-26 04:45:11,780 - INFO - Training Metrics...
2025-03-26 04:45:11,781 - INFO - {'loss': 0.46064282173202153, 'f1': 72.63326091088528, 'acc': 81.51914913252124, 'precision': 69.35004023572367, 'recall': 86.70784660907668, 'balanced acc': 86.70784660907668}
2025-03-26 04:45:11,781 - INFO - Validation Metrics... Inference time: 36.438
2025-03-26 04:45:11,781 - INFO - {'loss': 0.624993622303009, 'f1': 66.81365899778837, 'acc': 86.47093023255815, 'precision': 62.18977688829963, 'recall': 83.03384927111594, 'balanced acc': 83.03384927111594}
2025-03-26 04:45:11,781 - INFO - ==================================================
2025-03-26 04:56:17,369 - INFO - Epoch: 30/100. Training time: 113.781
2025-03-26 04:56:17,399 - INFO - Training Metrics...
2025-03-26 04:56:17,399 - INFO - {'loss': 0.4677660209792001, 'f1': 71.82564759969351, 'acc': 81.12393872277592, 'precision': 68.60515663309855, 'recall': 85.2380395829108, 'balanced acc': 85.2380395829108}
2025-03-26 04:56:17,399 - INFO - Validation Metrics... Inference time: 38.347
2025-03-26 04:56:17,399 - INFO - {'loss': 0.6000692844390869, 'f1': 67.3434617808701, 'acc': 87.0863284002819, 'precision': 62.813578537338685, 'recall': 82.88747497732803, 'balanced acc': 82.88747497732803}
2025-03-26 04:56:17,399 - INFO - ==================================================
2025-03-26 05:06:35,592 - INFO - Epoch: 35/100. Training time: 84.850
2025-03-26 05:06:35,657 - INFO - Training Metrics...
2025-03-26 05:06:35,658 - INFO - {'loss': 0.443225017615727, 'f1': 72.55632992132658, 'acc': 81.5766888150609, 'precision': 69.16046664741037, 'recall': 87.96634048799878, 'balanced acc': 87.96634048799878}
2025-03-26 05:06:35,658 - INFO - Validation Metrics... Inference time: 15.324
2025-03-26 05:06:35,658 - INFO - {'loss': 0.5826556086540222, 'f1': 67.11005833292383, 'acc': 87.21423537702609, 'precision': 62.21878515102715, 'recall': 82.82476952944565, 'balanced acc': 82.82476952944565}
2025-03-26 05:06:35,658 - INFO - ==================================================
2025-03-26 05:17:39,921 - INFO - Epoch: 40/100. Training time: 88.761
2025-03-26 05:17:39,946 - INFO - Training Metrics...
2025-03-26 05:17:39,947 - INFO - {'loss': 0.46351940575100126, 'f1': 73.59963184086459, 'acc': 82.59879106681434, 'precision': 69.97646553513079, 'recall': 87.58344707145793, 'balanced acc': 87.58344707145793}
2025-03-26 05:17:39,947 - INFO - Validation Metrics... Inference time: 30.497
2025-03-26 05:17:39,947 - INFO - {'loss': 0.5612285733222961, 'f1': 68.00372635683684, 'acc': 88.48255813953489, 'precision': 63.35170661407222, 'recall': 82.07335484417301, 'balanced acc': 82.07335484417301}
2025-03-26 05:17:39,947 - INFO - ==================================================
2025-03-26 05:28:02,934 - INFO - Epoch: 45/100. Training time: 96.461
2025-03-26 05:28:02,958 - INFO - Training Metrics...
2025-03-26 05:28:02,959 - INFO - {'loss': 0.45145506660143536, 'f1': 75.03710638408141, 'acc': 84.37606127722407, 'precision': 71.36899277383888, 'recall': 87.09667615377835, 'balanced acc': 87.09667615377835}
2025-03-26 05:28:02,959 - INFO - Validation Metrics... Inference time: 27.505
2025-03-26 05:28:02,959 - INFO - {'loss': 0.5727478265762329, 'f1': 67.71467164154055, 'acc': 87.4406272022551, 'precision': 63.292732823339584, 'recall': 82.91310106889202, 'balanced acc': 82.91310106889202}
2025-03-26 05:28:02,959 - INFO - ==================================================
2025-03-26 05:37:19,071 - INFO - Epoch: 50/100. Training time: 68.837
2025-03-26 05:37:19,086 - INFO - Training Metrics...
2025-03-26 05:37:19,086 - INFO - {'loss': 0.4643459916114807, 'f1': 73.64907752153425, 'acc': 83.71959210040606, 'precision': 69.62924073267608, 'recall': 87.58823695470811, 'balanced acc': 87.58823695470811}
2025-03-26 05:37:19,086 - INFO - Validation Metrics... Inference time: 26.727
2025-03-26 05:37:19,086 - INFO - {'loss': 0.5684095621109009, 'f1': 67.25006923944578, 'acc': 87.42389006342495, 'precision': 62.35787814064837, 'recall': 82.58478171211236, 'balanced acc': 82.58478171211236}
2025-03-26 05:37:19,086 - INFO - ==================================================
2025-03-26 05:46:59,826 - INFO - Epoch: 55/100. Training time: 99.999
2025-03-26 05:46:59,855 - INFO - Training Metrics...
2025-03-26 05:46:59,855 - INFO - {'loss': 0.41403169291360037, 'f1': 74.46350801859644, 'acc': 83.06506090808415, 'precision': 71.15553088741858, 'recall': 87.82706981642514, 'balanced acc': 87.82706981642514}
2025-03-26 05:46:59,855 - INFO - Validation Metrics... Inference time: 30.582
2025-03-26 05:46:59,855 - INFO - {'loss': 0.5556591153144836, 'f1': 67.40818626188046, 'acc': 87.91649048625793, 'precision': 62.49831517703793, 'recall': 82.10649279109082, 'balanced acc': 82.10649279109082}
2025-03-26 05:46:59,856 - INFO - ==================================================
2025-03-26 05:54:32,826 - INFO - Early stopping criterion met. Stopping training.
2025-03-26 05:54:39,069 - INFO - Initializing final Evaluations:

2025-03-26 05:54:47,737 - INFO - Final validation metrics:
{'f1': 68.18965447099926, 'acc': 88.59883720930233, 'precision': 63.63603529822204, 'recall': 82.06849410885593, 'balanced acc': 82.06849410885593}
2025-03-26 05:54:56,479 - INFO - Final test pixel-wise classification metrics:
{'f1': 22.88613610242506, 'acc': 84.40750528541227, 'precision': 21.101876321353068, 'recall': 25.0, 'balanced acc': 25.0}
